import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/sys/user/login',
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: '/sys/user/info',
    method: 'get',
    params: {}
  })
}

export function getMenu() {
  return request({
    url: '/sys/user/menu',
    method: 'get',
    params: {}
  })
}

export function logout() {
  return request({
    url: '/sys/user/logout',
    method: 'post'
  })
}

export function getList(data, params) {
  return request({
    url: '/sys/user/list',
    method: 'post',
    data,
    params
  })
}

export function saveUser(data) {
  return request({
    url: '/sys/user/save',
    method: 'post',
    data
  })
}

export function getUserByRole(data) {
  return request({
    url: '/sys/user/getUserByRole',
    method: 'post',
    data
  })
}

export function deleteUser(data) {
  return request({
    url: '/sys/user/delete',
    method: 'post',
    data
  })
}
